package com.example.evaluate.util;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class AjaxUtil {

    /**
     * 对于ajax请求，返回请求结果
     * @param out
     * @param response
     */
    public static void writeJSON2Response(Object out, HttpServletResponse response) {
        response.setCharacterEncoding("UTF-8");
        response.setContentType("text/html;charset=UTF-8");
        try {
            response.getWriter().print(out);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
